package com.shijianchen.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shijianchen.mapper.SpShopUserMapper;
import com.shijianchen.projo.SpShopUser2;
import com.shijianchen.service.SpShopUserService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class SpShopUserServiceImpl extends ServiceImpl<SpShopUserMapper, SpShopUser2> implements SpShopUserService {
    @Override
    public List<SpShopUser2> selectList() {
        return list();
    }

    @Override
    public ArrayList<Map<String, Object>> selectListForMap() {
        List<SpShopUser2> spShopUser2s = selectList();
        ArrayList<Map<String,Object>> arrayList = new ArrayList<>();
        spShopUser2s.forEach((spShopUser2)->{
            Map<String,Object> dictMap = new HashMap<>();
            dictMap.put("label",spShopUser2.getShopname());
            dictMap.put("value",spShopUser2.getMemberId());

            arrayList.add(dictMap);
        });
        return arrayList;
    }
}
